package com.twu.biblioteca.model;


public class LibraryEntry {
    private Item item;
    private String typeOfItem;
    private boolean isCheckedOut;
    private String checkedOutByUser;

    public LibraryEntry(Item item, String typeOfItem, boolean isCheckedOut, String checkedOutByUser) {
        this.item = item;
        this.typeOfItem = typeOfItem;
        this.isCheckedOut = isCheckedOut;
        this.checkedOutByUser = checkedOutByUser;
    }

    public LibraryEntry(Item item, String typeOfItem, boolean isCheckedOut) {
        this.item = item;
        this.typeOfItem = typeOfItem;
        this.isCheckedOut = isCheckedOut;
        this.checkedOutByUser = null;
    }

    public Item getItem() {
        return item;
    }

    public String getTypeOfItem() {
        return typeOfItem;
    }
    public boolean isCheckedOut() {
        return isCheckedOut;
    }

    public void setCheckedOut(boolean isCheckedOut) {
        this.isCheckedOut = isCheckedOut;
    }

    public void toggleCheckedOut(){ this.isCheckedOut = !this.isCheckedOut;}


    public String getCheckedOutByUser() {
        return checkedOutByUser;
    }

    public void setCheckedOutByUser(String checkedOutByUser) {
        this.checkedOutByUser = checkedOutByUser;
    }

    public void setCheckedOutByUser() {
        checkedOutByUser = null;
    }
}
